<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_users
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @since		1.6
 */

defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.noframes');
$app	= JFactory::getApplication();
$template = $app->getTemplate();
$email = $app->getUserStateFromRequest("com_users.registration.email",NULL);
$usertype = $app->getUserStateFromRequest("com_users.registration.usertype", 2);
$password = $app->getUserStateFromRequest("com_users.registration.password",NULL);
//echo $email.'<br>';
//echo $usertype.'<br>';
//echo $password.'<br>';

?>
 <?php                        	       
$input_name = JText::_( 'Indtast din virksomhed navn' );
$input_phone = JText::_( 'Indtast din telefon' );
$input_address = JText::_( 'Indtast din adresse' );
$input_postcode = JText::_( 'Indtast din post nr' );
$input_city = JText::_( 'Indtast din by' );
$input_birthday = JText::_( 'Indtast din fødselsdag' );
$input_description = JText::_( 'Indtast din beskrivelse' );
	
?>                        
 <script type="text/javascript">                   
jQuery(document).ready(function(jQuery) {
	jQuery.validator.addMethod('postalcode', function (value) { 
		if(value=='') return true;	
		return /^\d{4}$/.test(value); 
	   }, '');
		jQuery("#postcode2").mask("9999",{placeholder:""});  
		
		jQuery("#f-signup1").validate(
			{
				errorPlacement: function(error, element) {			
			},
			invalidHandler: function(form, validator) {
			  var errors = validator.numberOfInvalids();
			if (errors) {
                //$('#alert').html(validator['errorList'][0]['message']);
				jQuery('#alert').html(validator['errorList'][0]['message']);
    			jQuery('#backoverlay').show();
    			jQuery('#show_popup').show();
            	jQuery('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
				
			  } else {
			  }
			},
			rules: {
				name2:{
					required: true,
				},			
				phone: {
					required: true,
					digits:true,
					minlength:6
				},
				address: {
					required: true,
				},
				postcode2:{
					required: true,
					digits: true,
					minlength: 4,
					maxlength: 4
				},
				city2:{
					required: true,
				},
				datepicker2:{
					required: true,
				},
				description:{
					required: true,
				},
				filecustom: { required: false, accept: "png|jpg|jpeg|gif"}
			},
			messages: {
				name2: "<?php echo $input_name; ?>",
				phone: "<?php echo $input_phone; ?>",
				address: "<?php echo $input_address; ?>",
				postcode2: "<?php echo $input_postcode; ?>",
				city2: "<?php echo $input_city; ?>",
				datepicker2: "<?php echo $input_birthday; ?>",
				description: "<?php echo $input_description; ?>",
				filecustom: "Filer skal være JPG, PNG , JPEG"
			}
		});
        close_popup=function(){		
			var fel=jQuery('#f_focus').html();
            jQuery('#backoverlay').hide();
    		jQuery('#show_popup').hide();
    		jQuery('#' + fel ).focus();		
      };
      
      
	});
</script>
<div id="header">
  <div id="w-header">
    <div class="logo"><a href="index.php">Forside</a> </div>
    <!--.logo-->
     {module login menu}    
    <!--.nav-top-1-->
    <div class="clear"></div>
    <div class="main-nav">
      {module main menu}
    </div>
    <!--.main-nav-->
    <div class="clear"></div>
  </div>
  <!--#w-header--> 
</div>
<!--#header-->

<div id="main">
  <div id="w-main">
    <div id="main-left">
	<div class="left-find"></div>
	<div class="right-find"></div>
		<div class="find">
			{module search}
		</div> 
      <!--.find-->
      <div class="clear"></div>
      <div class="infomation">
		<?php $article = JUtility::getArticle(15); ?>
        <h2><a href="#"><?php echo $article->title; ?></a></h2>
        <?php echo $article->introtext; ?>
      </div>
      <!--.infomation--> 
    </div>
    <!--#main-left-->
    <div id="main-right2">
     <div id="edit-account-page">
       	<div class="edit-account-content">
		<?php $article = JUtility::getArticle(6); ?>
       		<h2><?php echo $article->title; ?></h2>
			<p><?php echo strip_tags($article->introtext,"<b><br><a>");?></p>  
		<form class="f-create-order" name="f-signup1" id="f-signup1" action="" method="post">
            	<fieldset>
                	<div>
               	  <label>VIRKSOMHED NAVN:</label><br>
                    <input name="name2" id="name2" type="text" value="">
                </div>
                <div>
               	  <label>TELEFON:</label><br>
                    <input name="phone" id="phone" type="text" value="">
                </div>
				<div>
               	  <label>Adresse:</label><br>
                    <input  name="address" id="address" type="text" value="">
                </div>
                <div class="w88">
               	  <label>POST NR: </label><br>
                    <input  name="postcode2" id="postcode2" type="text" value="" maxlength="4" class="w88">
                </div>
                <div class="w260">
               	  <label>BY:</label><br>
                    <input  name="city2" id="city2" type="text" value="" class="w260">
                </div>
				<?php if($usertype==9) :?>
                <div>
               	   <label>Billeder:</label><br>
                   <span class="add-photo3">
                        <input type="file" style="position: relative; 
                        height: 30px; width: 345px; cursor: pointer; opacity: 0;" value="" name="filecustom" class="add-photo" id="filecustom">
                   </span>
                </div>
				<?php else: ?>
                <div>               	 
                  <label>FøDSELSDAG:</label><br>
                  <input type="text" value="" style="background: url(templates/<?php echo $template; ?>/images/bg-input-datapicker2.png) no-repeat right;  cursor: pointer; " id="datepicker2" name="datepicker2">
                </div>
				<?php endif; ?>
                <div>
               	  <label>Beskrivelse:</label><br>
                    <textarea name="description" id="description" rows="" cols="" ></textarea>
                </div>
                    <div class="clear"></div>
                  <div class="bnt-confirm">
                	<a onclick="jQuery('#f-signup1').submit();">confirm</a>
                </div><!--bnt-confirm-->
                <div class="back">
                	<h4><a onclick="javascript:history.back();" href="javascript:\\">Tilbage</a></h4>
                </div><!--.black-->
            <input type="hidden" name="email" value="<?php echo $email; ?>" />
			<input type="hidden" name="usertype" value="<?php echo $usertype; ?>" />
			<input type="hidden" name="password" value="<?php echo $password; ?>" />
			<input type="hidden" name="option" value="com_users" />
			<input type="hidden" name="task" value="registration2.register2" />
			<?php echo JHtml::_('form.token');?> 
			</fieldset>
            </form>
      	</div>
      <!--.f-create-Order--> 
      
      </div>
    <!--#main-right--> 
  </div>
  <!--#w-main--> 
</div>
<!--#main-->
<div class="clear"></div>
<div id="contact">
  <div id="w-contact">
    <div class="left-con">
      <div class="left-con-top"></div>
      <!--left-con-top-->
      <div class="left-con-mid">
        <div class="contact-con">
		<?php $article = JUtility::getArticle(17); ?>
          <h2><a href="#"><?php echo $article->title; ?></a></h2>
          <?php echo $article->introtext; ?>
        </div>
        <!--.contact-con-->
        <div class="contact-con contact-con2">
			<?php $article = JUtility::getArticle(18); ?>
			<h2><a href="#"><?php echo $article->title; ?></a></h2>
			<?php echo $article->introtext; ?>
        </div>
        <!--.contact-con--> 
      </div>
      <!--left-con-mid-->
      <div class="left-con-bottom"></div>
      <!--left-con-bottom--> 
    </div>
    <!--.left-con-->
    
    <div class="address">
		<?php $article = JUtility::getArticle(16); ?>
		<h2><?php echo $article->title; ?></h2>
		<?php echo $article->introtext; ?>
    </div>
    <!--address--> 
    
    <div class="contact-form">
		{module kontakt}
    </div><!--.contact-form-->
  </div>
  <!--w-contact--> 
</div>
<!--#contact-->
<div class="clear"></div>
<div id="copyright">
	<div id="w-copyright">
		{module footer}
	</div>
</div>
<!--#copyright-->





<?php return; ?> 
  <div id="header2">
  <div id="w-header2">
   	<div class="logo2"><a href="<?php echo JRoute::_('.');?>">kokketilbud</a></div><!--.logo2-->
  </div>
  <!--#w-header2--> 
</div>
<!--#header2-->
<div id="main2">
  <div id="w-main2">
    <div id="login-page">
    <h2><?php echo $article->title;?></h2>
    <div class="w-login-form m-b-100">
   	  <div class="login-top-page"></div><!--.login-top-page-->
      <div class="login-mid-page">
      	<form method="post" name="f-signup1" id="f-signup1" class="f-signup" enctype="multipart/form-data">
        	<fieldset>
            	<p class="m-b-32"><?php echo strip_tags($article->introtext,"<b><br><a>");?></p>            
            	<div>
               	  <label>VIRKSOMHED NAVN:</label><br>
                    <input name="name" id="name" type="text" value="">
                </div>
                <div>
               	  <label>TELEFON:</label><br>
                    <input name="phone" id="phone" type="text" value="">
                </div>
                <div>
               	  <label>Adresse:</label><br>
                    <input  name="address" id="address" type="text" value="">
                </div>
                <div class="w88">
               	  <label>POST NR: </label><br>
                    <input  name="postcode" id="postcode" type="text" value="" maxlength="4" class="w88">
                </div>
                <div class="w180">
               	  <label>BY:</label><br>
                    <input  name="city" id="city" type="text" value="" class="w180">
                </div>
				<?php if($usertype==9) :?>
                <div>
               	   <label>Billeder:</label><br>
                   <span class="add-photo3">
                        <input type="file" style="position: relative; 
                        height: 30px; width: 275px; cursor: pointer; opacity: 0;" value="" name="filecustom" class="add-photo" id="filecustom">
                   </span>
                </div>
				<?php else: ?>
                <div>               	 
                  <label>FøDSELSDAG:</label><br>
                  <input type="text" value="" style="background: url(templates/<?php echo $template; ?>/images/bg-input-datapicker4.png) no-repeat right;  cursor: pointer; " id="datepicker" name="datepicker">
                </div>
				<?php endif; ?>
                <div class="m-b-16">
               	  <label>Beskrivelse:</label><br>
                    <textarea name="description" id="description" rows="" cols="" ></textarea>
                </div>
              
               
                <div class="bnt-confirm">
                	<a onclick="jQuery('#f-signup1').submit();">confirm</a>
                </div><!--bnt-confirm-->
                <div class="back">
                	<h4><a onclick="javascript:history.back();" href="javascript:\\">Tilbage</a></h4>
                </div><!--.black-->
                
            </fieldset>
			<input type="hidden" name="email" value="<?php echo $email; ?>" />
			<input type="hidden" name="usertype" value="<?php echo $usertype; ?>" />
			<input type="hidden" name="password" value="<?php echo $password; ?>" />
			<input type="hidden" name="option" value="com_users" />
			<input type="hidden" name="task" value="registration2.register2" />
			<?php echo JHtml::_('form.token');?>
        </form>
        <div class="clear"></div>
      </div><!--.login-mid-page-->
      <div class="login-bottom-page"></div><!--.login-bottom-page-->
    </div><!--#login-page-->
    </div><!--.w-login-form-->
   </div><!--#w-main2-->   
</div><!--#main2-->








<?php return;?>

<div class="registration<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
	<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>

	<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="form-validate">
<?php foreach ($this->form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?>
	<?php $fields = $this->form->getFieldset($fieldset->name);?>
	<?php if (count($fields)):?>
		<fieldset>
		<?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend.
		?>
			<legend><?php echo JText::_($fieldset->label);?></legend>
		<?php endif;?>
			<dl>
		<?php foreach($fields as $field):// Iterate through the fields in the set and display them.?>
			<?php if ($field->hidden):// If the field is hidden, just display the input.?>
				<?php echo $field->input;?>
			<?php else:?>
				<dt>
					<?php echo $field->label; ?>
					<?php if (!$field->required && $field->type!='Spacer'): ?>
						<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?></span>
					<?php endif; ?>
				</dt>
				<dd><?php echo ($field->type!='Spacer') ? $field->input : "&#160;"; ?></dd>
			<?php endif;?>
		<?php endforeach;?>
			</dl>
		</fieldset>
	<?php endif;?>
<?php endforeach;?>
		<div>
			<button type="submit" class="validate"><?php echo JText::_('JREGISTER');?></button>
			<?php echo JText::_('COM_USERS_OR');?>
			<a href="<?php echo JRoute::_('');?>" title="<?php echo JText::_('JCANCEL');?>"><?php echo JText::_('JCANCEL');?></a>
			<input type="hidden" name="option" value="com_users" />
			<input type="hidden" name="task" value="registration.register" />
			<?php echo JHtml::_('form.token');?>
		</div>
	</form>
</div>
